package com.hdoit.apollo.logical.cargo.dao.impl;

import org.springframework.stereotype.Component;

import com.hdoit.apollo.logical.cargo.dao.IPictureDao;
import com.hdoit.apollo.logical.cargo.model.Picture;
import com.tennetcn.data.dao.base.ISqlExpression;
import com.tennetcn.data.dao.base.impl.SuperDao;
import com.tennetcn.data.utils.SqlExpressionFactory;
/**
 * @author      tancongzhu
 * @email       
 * @createtime  2018年05月10日 15:07:15
 * @comment
 */
@Component
public class PictureDaoImpl extends SuperDao<Picture> implements IPictureDao{

	@Override
	public boolean deleteByCargoId(String cargoId) {
		ISqlExpression sqlExpression = SqlExpressionFactory.createExpression();
		sqlExpression.addBody("delete from",Picture.class)
					.andWhere("cargoId=#{cargoId}")
					.setParam("cargoId", cargoId);
		return delete(sqlExpression)>=0;
	}

}